#pragma once

#include "qbe/src/ecs/plugin.hpp"
#include "qbe/src/ecs/stage.hpp"
#include "qbe/src/state/state.hpp"
#include "../../message/message.hpp"

namespace qbe::draw::onlyread {

void init(entt::registry& reg, ecs::Commands commands, ecs::Query query);
void update(entt::registry& reg, ecs::Query query, ecs::Bus& bus, ecs::EventWriter<msg::RenderEvent> event);
void post(entt::registry& reg, ecs::Commands commands, ecs::Query query, ecs::Bus& bus);

class OnlyReadPlugin : public ecs::Plugin {
 public:
  void build(ecs::App& app) override {
    app.add_systems<ecs::stage::Startup>(init);
    app.add_systems<ecs::stage::Update>(update);
    app.add_systems<ecs::stage::PostUpdate>(post);
  };
};

}  // namespace qbe::draw::onlyread